

<template>
    <div class="class-list">
        <div class="list">
            <div class="item" v-for="item in list" :key="item.order" @click="toPage(item)">
                <img class="img" :src="item.img" alt="">
                <div class="title">{{ item.name }}</div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import router from '@/router';
import type { tomatoesMdoel } from '../../api/index'
defineProps<{
    list: tomatoesMdoel[]
}>()

const toPage = (item) => {
    router.push(`/listenlist`)
    console.log(item);

}

</script>

<style lang="less" scoped>
.class-list {
    padding: 0 10%;
    margin: 10px 0;

    .list {
        width: 100%;
        display: flex;
        align-content: center;

        .item {
            width: 20%;
            display: flex;
            flex-direction: column;
            align-items: center;

            .img {
                width: 40px;
                height: 40px;
                border-radius: 50%;
            }

            .title {
                font-size: 16px;
                white-space: nowrap;
            }
        }
    }


}
</style>